import request from '@/utils/request'

// 查询采购需求申请单列表
export function listPurchaseRequirement(query) {
  return request({
    url: '/sci/purchaseRequirement/list',
    method: 'get',
    params: query
  })
}

// 查询采购需求申请单详细
export function getPurchaseRequirement(id) {
  return request({
    url: '/sci/purchaseRequirement/' + id,
    method: 'get'
  })
}

// 新增采购需求申请单
export function addPurchaseRequirement(data) {
  return request({
    url: '/sci/purchaseRequirement',
    method: 'post',
    data: data
  })
}

// 修改采购需求申请单
export function updatePurchaseRequirement(data) {
  return request({
    url: '/sci/purchaseRequirement',
    method: 'put',
    data: data
  })
}

// 删除采购需求申请单
export function delPurchaseRequirement(id) {
  return request({
    url: '/sci/purchaseRequirement/' + id,
    method: 'delete'
  })
}

// 查询采购需求明细列表
export function listPurchaseDetails(code) {
  return request({
    url: '/sci/purchaseRequirement/listById/' + code,
    method: 'get'
  })
}